<template>
  <view class="status-bar">
    <view class="status-item">
      <view class="status-label">
        <text class="status-icon">❤️</text>
        <text class="status-text">生命值</text>
        <text class="status-value">{{ gameState.health }}%</text>
      </view>
      <view class="status-progress">
        <view class="progress-bar health-bar" :style="{ width: gameState.health + '%' }"></view>
      </view>
    </view>
    
    <view class="status-item">
      <view class="status-label">
        <text class="status-icon">🍽️</text>
        <text class="status-text">饥饿度</text>
        <text class="status-value">{{ gameState.hunger }}%</text>
      </view>
      <view class="status-progress">
        <view class="progress-bar hunger-bar" :style="{ width: gameState.hunger + '%' }"></view>
      </view>
    </view>
    
    <view class="status-item">
      <view class="status-label">
        <text class="status-icon">💧</text>
        <text class="status-text">口渴度</text>
        <text class="status-value">{{ gameState.thirst }}%</text>
      </view>
      <view class="status-progress">
        <view class="progress-bar thirst-bar" :style="{ width: gameState.thirst + '%' }"></view>
      </view>
    </view>
    
    <view class="status-item stamina-item">
      <view class="status-label">
        <text class="status-icon">⚡</text>
        <text class="status-text">体力值</text>
        <text class="status-value">{{ gameState.energy }}%</text>
      </view>
      <view class="status-progress">
        <view class="progress-bar energy-bar" :style="{ width: gameState.energy + '%' }"></view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'GameStatusBar',
  props: {
    gameState: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped>
/* 游戏状态指标 */
.status-bar {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10rpx);
  border-bottom: 1rpx solid #374151;
  padding: 16rpx 32rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 8rpx;
  flex: 1;
}

.stamina-item {
  flex: 0 0 200rpx;
}

.status-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20rpx;
}

.status-icon {
  font-size: 20rpx;
  margin-right: 8rpx;
}

.status-text {
  color: #9ca3af;
  flex: 1;
}

.status-value {
  color: white;
  font-weight: bold;
  font-size: 20rpx;
}

.status-progress {
  height: 8rpx;
  background: rgba(55, 65, 81, 0.5);
  border-radius: 4rpx;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4rpx;
  transition: width 0.5s ease-out;
}

.health-bar {
  background: #dc2626;
}

.hunger-bar {
  background: #f59e0b;
}

.thirst-bar {
  background: #1d4ed8;
}

.energy-bar {
  background: #059669;
}
</style>
